const mongoose = require('mongoose');
const {
  MONGODB: {
    url,
    options
  }
} = require('../../config');

mongoose.connect(url, options);
const db = mongoose.connection;
db.on('error', err => {
  throw err;
});
db.once('open', () => {
  console.log(`mongoDB Successful connection to ${url}`);
});


exports.mongoose = mongoose;
exports.mongooseDB = db;